import { EntityId, PageQueryParams } from 'kf-web-library';

export interface NewsPageQueryParams extends Partial<PageQueryParams> {
  searchText?: string;
  ids?: EntityId[];
  journalId?: EntityId; //所属期刊
  type?: string | string[]; //业务类型集合 NewsType
  sources?: string[]; //来源
  opened?: boolean; //是否上架
}

export interface News_Query {
  type: string[]; //业务分类
  source: string[]; //来源
}

export interface News {
  deleted: number; //删除标记
  id: number; //主键
  journalId: string; //所属期刊ID
  type: string; //新闻资讯类型 NewsType
  source: string; //来源
  title: string; //标题
  abstractContent: string; //摘要
  img: string; //封面图
  video: string; //视屏
  link: string; //链接地址
  content: string; //内容
  orderNum: number; //排序号
  opened: boolean; //是否上架
  openedTime: string; //上架时间
  createTime: string; //创建时间
  createUserId: number; //${column.comment}
  modifyTime: string; //修改时间
  modifyUserId: number; //${column.comment}
}

export interface News_Create {
  journalId: string; //所属期刊ID
  type: string; //新闻资讯类型 NewsType
  source: string; //来源
  title: string; //标题
  abstractContent: string; //摘要
  img: string; //封面图
  video: string; //视屏
  link: string; //链接地址
  content: string; //内容
  orderNum: number; //排序号
  opened: boolean; //是否上架
  openedTime: string; //上架时间
}

export interface News_Modify extends News_Create {
  id: EntityId;
}

export interface News_Patch extends Partial<News_Modify> {
  id: EntityId;
}
